def tribonacci_sequence(start_sequence: list[int], length: int) -> list[int]:
    sequence = start_sequence[:]
    if length == 0:
        sequence = []
    elif length <= 3:
        sequence = start_sequence[:length]
    else:
        for _ in range(length - 3):
            sequence.append(sum(sequence[-3:]))
    return sequence


if __name__ == '__main__':
    print(tribonacci_sequence([0, 0, 1], 20))